package com.xqls.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqls.bean.CostBean;
import com.xqls.dal.dao.CostDao;
import com.xqls.dal.model.Cost;
import com.xqls.service.CostService;
import com.xqls.util.ObjectUtil;

@Service
public class CostServiceImpl implements CostService {
	
	@Autowired private CostDao dao;

	@Override
	public List<Map<String, Object>> queryByMap(Map<String, Object> map) {
		return dao.selectByMap(map);
	}
	
	@Override
	public boolean add(CostBean costBean){
		return dao.add((Cost)ObjectUtil.transfer(costBean, Cost.class));
	}

	@Override
	public List<Map<String, Object>> getmap(Map<String, Object> map){
		return dao.getAllmap(map);
	}

	@Override
	public CostBean selectByKey(Integer costId){
		return (CostBean) ObjectUtil.transfer(dao.selectByKey(costId), CostBean.class);
	}
	
	
	@Override
	public boolean update(CostBean cost) {
		return dao.update((Cost)ObjectUtil.transfer(cost, Cost.class));
	}
}
